﻿namespace CRM.DataAccess.DAOs
{
    using System.Collections.Generic;
    using System.Data.Entity;
    using CRM.DataAccess.Entities;
    using System.Linq;

    public class CarrierDAO : DbContext
    {
        public CarrierDAO()
            : base("name=Entities")
        {            
        }
        public virtual DbSet<CARRIER> CARRIERs { get; set; }

        //Get All Carrier
        public List<CARRIER> ListAll()
        {
            try
            {
                var Query = from c in CARRIERs
                                select c;
                List<CARRIER> cs = Query.ToList();
                if (cs.Count > 0)
                    return cs;
                return null;
            }
            catch
            {
                return null;
            }
        }       
    }
}
